//
// Este archivo ha sido generado por la arquitectura JavaTM para la implantación de la referencia de enlace (JAXB) XML v2.2.7 
// Visite <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
// Todas las modificaciones realizadas en este archivo se perderán si se vuelve a compilar el esquema de origen. 
// Generado el: 2014.07.22 a las 11:49:28 PM ART 
//

package org.gabrielnegri.fitparser.entities;

import java.util.ArrayList;
import java.util.List;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlSchemaType;
import javax.xml.bind.annotation.XmlType;
import javax.xml.datatype.XMLGregorianCalendar;

import org.gabrielnegri.fitparser.Populable;

import com.google.gson.annotations.Expose;

/**
 * <p>
 * Clase Java para ActivityLap_t complex type.
 * 
 * <p>
 * El siguiente fragmento de esquema especifica el contenido que se espera que
 * haya en esta clase.
 * 
 * <pre>
 * &lt;complexType name="ActivityLap_t">
 *   &lt;complexContent>
 *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       &lt;sequence>
 *         &lt;element name="TotalTimeSeconds" type="{http://www.w3.org/2001/XMLSchema}double"/>
 *         &lt;element name="DistanceMeters" type="{http://www.w3.org/2001/XMLSchema}double"/>
 *         &lt;element name="MaximumSpeed" type="{http://www.w3.org/2001/XMLSchema}double" minOccurs="0"/>
 *         &lt;element name="Calories" type="{http://www.w3.org/2001/XMLSchema}unsignedShort"/>
 *         &lt;element name="AverageHeartRateBpm" type="{http://www.garmin.com/xmlschemas/TrainingCenterDatabase/v2}HeartRateInBeatsPerMinute_t" minOccurs="0"/>
 *         &lt;element name="MaximumHeartRateBpm" type="{http://www.garmin.com/xmlschemas/TrainingCenterDatabase/v2}HeartRateInBeatsPerMinute_t" minOccurs="0"/>
 *         &lt;element name="Intensity" type="{http://www.garmin.com/xmlschemas/TrainingCenterDatabase/v2}Intensity_t"/>
 *         &lt;element name="Cadence" type="{http://www.garmin.com/xmlschemas/TrainingCenterDatabase/v2}CadenceValue_t" minOccurs="0"/>
 *         &lt;element name="TriggerMethod" type="{http://www.garmin.com/xmlschemas/TrainingCenterDatabase/v2}TriggerMethod_t"/>
 *         &lt;element name="Track" type="{http://www.garmin.com/xmlschemas/TrainingCenterDatabase/v2}Track_t" maxOccurs="unbounded" minOccurs="0"/>
 *         &lt;element name="Notes" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
 *         &lt;element name="Extensions" type="{http://www.garmin.com/xmlschemas/TrainingCenterDatabase/v2}Extensions_t" minOccurs="0"/>
 *       &lt;/sequence>
 *       &lt;attribute name="StartTime" use="required" type="{http://www.w3.org/2001/XMLSchema}dateTime" />
 *     &lt;/restriction>
 *   &lt;/complexContent>
 * &lt;/complexType>
 * </pre>
 * 
 * 
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "ActivityLap_t", propOrder = { "totalTimeSeconds",
		"distanceMeters", "maximumSpeed", "calories", "averageHeartRateBpm",
		"maximumHeartRateBpm", "intensity", "cadence", "triggerMethod",
		"track", "notes", "extensions", "averageHeartRate", "maximumHeartRate" })
public class ActivityLapT implements Populable {

	@XmlElement(name = "TotalTimeSeconds")
	@Expose
	protected double totalTimeSeconds;
	@XmlElement(name = "DistanceMeters")
	@Expose
	protected double distanceMeters;
	@XmlElement(name = "MaximumSpeed")
	@Expose
	protected Double maximumSpeed;
	@XmlElement(name = "Calories")
	@XmlSchemaType(name = "unsignedShort")
	@Expose
	protected int calories;
	@XmlElement(name = "AverageHeartRateBpm")
	protected HeartRateInBeatsPerMinuteT averageHeartRateBpm;
	@XmlElement(name = "MaximumHeartRateBpm")
	protected HeartRateInBeatsPerMinuteT maximumHeartRateBpm;
	@XmlElement(name = "Intensity", required = true)
	@Expose
	protected IntensityT intensity;
	@XmlElement(name = "Cadence")
	@Expose
	protected Short cadence;
	@XmlElement(name = "TriggerMethod", required = true)
	@Expose
	protected TriggerMethodT triggerMethod;
	@XmlElement(name = "Track")
	@Expose
	protected List<TrackT> track;
	@XmlElement(name = "Notes")
	@Expose
	protected String notes;
	@XmlElement(name = "Extensions")
	protected ExtensionsT extensions;
	@XmlAttribute(name = "StartTime", required = true)
	@XmlSchemaType(name = "dateTime")
	@Expose
	protected XMLGregorianCalendar startTime;

	@Expose
	protected short averageHeartRate;
	@Expose
	protected short maximumHeartRate;

	/**
	 * Obtiene el valor de la propiedad totalTimeSeconds.
	 * 
	 */
	public double getTotalTimeSeconds() {
		return totalTimeSeconds;
	}

	/**
	 * Define el valor de la propiedad totalTimeSeconds.
	 * 
	 */
	public void setTotalTimeSeconds(double value) {
		this.totalTimeSeconds = value;
	}

	/**
	 * Obtiene el valor de la propiedad distanceMeters.
	 * 
	 */
	public double getDistanceMeters() {
		return distanceMeters;
	}

	/**
	 * Define el valor de la propiedad distanceMeters.
	 * 
	 */
	public void setDistanceMeters(double value) {
		this.distanceMeters = value;
	}

	/**
	 * Obtiene el valor de la propiedad maximumSpeed.
	 * 
	 * @return possible object is {@link Double }
	 * 
	 */
	public Double getMaximumSpeed() {
		return maximumSpeed;
	}

	/**
	 * Define el valor de la propiedad maximumSpeed.
	 * 
	 * @param value
	 *            allowed object is {@link Double }
	 * 
	 */
	public void setMaximumSpeed(Double value) {
		this.maximumSpeed = value;
	}

	/**
	 * Obtiene el valor de la propiedad calories.
	 * 
	 */
	public int getCalories() {
		return calories;
	}

	/**
	 * Define el valor de la propiedad calories.
	 * 
	 */
	public void setCalories(int value) {
		this.calories = value;
	}

	/**
	 * Obtiene el valor de la propiedad averageHeartRateBpm.
	 * 
	 * @return possible object is {@link HeartRateInBeatsPerMinuteT }
	 * 
	 */
	public HeartRateInBeatsPerMinuteT getAverageHeartRateBpm() {
		return averageHeartRateBpm;
	}

	/**
	 * Define el valor de la propiedad averageHeartRateBpm.
	 * 
	 * @param value
	 *            allowed object is {@link HeartRateInBeatsPerMinuteT }
	 * 
	 */
	public void setAverageHeartRateBpm(HeartRateInBeatsPerMinuteT value) {
		this.averageHeartRateBpm = value;
	}

	/**
	 * Obtiene el valor de la propiedad maximumHeartRateBpm.
	 * 
	 * @return possible object is {@link HeartRateInBeatsPerMinuteT }
	 * 
	 */
	public HeartRateInBeatsPerMinuteT getMaximumHeartRateBpm() {
		return maximumHeartRateBpm;
	}

	/**
	 * Define el valor de la propiedad maximumHeartRateBpm.
	 * 
	 * @param value
	 *            allowed object is {@link HeartRateInBeatsPerMinuteT }
	 * 
	 */
	public void setMaximumHeartRateBpm(HeartRateInBeatsPerMinuteT value) {
		this.maximumHeartRateBpm = value;
	}

	/**
	 * Obtiene el valor de la propiedad intensity.
	 * 
	 * @return possible object is {@link IntensityT }
	 * 
	 */
	public IntensityT getIntensity() {
		return intensity;
	}

	/**
	 * Define el valor de la propiedad intensity.
	 * 
	 * @param value
	 *            allowed object is {@link IntensityT }
	 * 
	 */
	public void setIntensity(IntensityT value) {
		this.intensity = value;
	}

	/**
	 * Obtiene el valor de la propiedad cadence.
	 * 
	 * @return possible object is {@link Short }
	 * 
	 */
	public Short getCadence() {
		return cadence;
	}

	/**
	 * Define el valor de la propiedad cadence.
	 * 
	 * @param value
	 *            allowed object is {@link Short }
	 * 
	 */
	public void setCadence(Short value) {
		this.cadence = value;
	}

	/**
	 * Obtiene el valor de la propiedad triggerMethod.
	 * 
	 * @return possible object is {@link TriggerMethodT }
	 * 
	 */
	public TriggerMethodT getTriggerMethod() {
		return triggerMethod;
	}

	/**
	 * Define el valor de la propiedad triggerMethod.
	 * 
	 * @param value
	 *            allowed object is {@link TriggerMethodT }
	 * 
	 */
	public void setTriggerMethod(TriggerMethodT value) {
		this.triggerMethod = value;
	}

	/**
	 * Gets the value of the track property.
	 * 
	 * <p>
	 * This accessor method returns a reference to the live list, not a
	 * snapshot. Therefore any modification you make to the returned list will
	 * be present inside the JAXB object. This is why there is not a
	 * <CODE>set</CODE> method for the track property.
	 * 
	 * <p>
	 * For example, to add a new item, do as follows:
	 * 
	 * <pre>
	 * getTrack().add(newItem);
	 * </pre>
	 * 
	 * 
	 * <p>
	 * Objects of the following type(s) are allowed in the list {@link TrackT }
	 * 
	 * 
	 */
	public List<TrackT> getTrack() {
		if (track == null) {
			track = new ArrayList<TrackT>();
		}
		return this.track;
	}

	/**
	 * Obtiene el valor de la propiedad notes.
	 * 
	 * @return possible object is {@link String }
	 * 
	 */
	public String getNotes() {
		return notes;
	}

	/**
	 * Define el valor de la propiedad notes.
	 * 
	 * @param value
	 *            allowed object is {@link String }
	 * 
	 */
	public void setNotes(String value) {
		this.notes = value;
	}

	/**
	 * Obtiene el valor de la propiedad extensions.
	 * 
	 * @return possible object is {@link ExtensionsT }
	 * 
	 */
	public ExtensionsT getExtensions() {
		return extensions;
	}

	/**
	 * Define el valor de la propiedad extensions.
	 * 
	 * @param value
	 *            allowed object is {@link ExtensionsT }
	 * 
	 */
	public void setExtensions(ExtensionsT value) {
		this.extensions = value;
	}

	/**
	 * Obtiene el valor de la propiedad startTime.
	 * 
	 * @return possible object is {@link XMLGregorianCalendar }
	 * 
	 */
	public XMLGregorianCalendar getStartTime() {
		return startTime;
	}

	/**
	 * Define el valor de la propiedad startTime.
	 * 
	 * @param value
	 *            allowed object is {@link XMLGregorianCalendar }
	 * 
	 */
	public void setStartTime(XMLGregorianCalendar value) {
		this.startTime = value;
	}

	public short getAverageHeartRate() {
		return averageHeartRate;
	}

	public void setAverageHeartRate(short averageHeartRate) {
		this.averageHeartRate = averageHeartRate;
	}

	public short getMaximumHeartRate() {
		return maximumHeartRate;
	}

	public void setMaximumHeartRate(short maximumHeartRate) {
		this.maximumHeartRate = maximumHeartRate;
	}

	@Override
	public void populate() {
		this.setAverageHeartRate(this.getAverageHeartRateBpm().getValue());
		this.setMaximumHeartRate(this.getMaximumHeartRateBpm().getValue());
		for (TrackT track : this.getTrack()) {
			track.populate();
		}
	}

}
